Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

JavascriptHeader module #99

Closed

Conversation

patriciomacadden
Copy link
Member

I've created a helper module named JavascriptHeader, which behaves like LinkModule, adding the javascript method, which returns script tags for linking javascript files.

Usage (ie in a slim template):

doctype html
head
  == javascript '/path/to/file.js'
body
  h1 Hello World

The result will be something like:

<!DOCTYPE html>
<html>
  <head>
    <script src="/path/to/file.js" type="text/javascript"></script>
  </head>
  <body>
    <h1>Hello World</h1>
  </body>
</html>

@patriciomacadden
Copy link
Member Author

This PR will fail until #100 gets merged.

@zzak
Copy link
Member

zzak commented Aug 11, 2013

I personally don't like this patch for two reasons:

  1. the javascript helper method name is too obscure
  2. it's too similar to javascript_include_tag, is %script{:src=>"foo.js", :type=>"text/javascript"} that hard to type?

What about asset managers? This is encroaching closely to their territory without much benefit.

@patriciomacadden
Copy link
Member Author

Yes, @zzak! You are totally right. Why didn't I closed this earlier? Sorry for the inconveniences!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants